/**
 * 命令执行相关样式
 * 包含命令确认对话框、执行状态、输出显示等
 */

/* 命令确认对话框 */
.command-confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.command-confirm-content {
    background-color: var(--vscode-editor-background, #1e1e1e);
    border: 1px solid var(--vscode-input-border, #3c3c3c);
    border-radius: 8px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.command-confirm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--vscode-widget-border, rgba(255, 255, 255, 0.1));
}

.command-confirm-header .codicon {
    font-size: 20px;
    color: var(--vscode-editorWarning-foreground, #cca700);
}

.command-confirm-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--vscode-foreground, #cccccc);
}

.command-confirm-body {
    margin-bottom: 20px;
}

.command-preview {
    background-color: var(--vscode-textCodeBlock-background, #2d2d2d);
    border: 1px solid var(--vscode-input-border, #3c3c3c);
    border-radius: 4px;
    padding: 12px;
    margin: 12px 0;
    font-family: var(--vscode-editor-font-family, 'Consolas', 'Courier New', monospace);
    font-size: 0.9em;
    color: var(--vscode-editor-foreground, #d4d4d4);
    word-break: break-all;
    white-space: pre-wrap;
}

.command-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    background-color: var(--vscode-editorWarning-background, rgba(204, 167, 0, 0.1));
    border-left: 3px solid var(--vscode-editorWarning-foreground, #cca700);
    border-radius: 4px;
    margin-top: 12px;
}

.command-warning .codicon {
    color: var(--vscode-editorWarning-foreground, #cca700);
    margin-top: 2px;
}

.command-warning-text {
    flex: 1;
    font-size: 0.9em;
    color: var(--vscode-foreground, #cccccc);
    line-height: 1.4;
}

.command-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 命令执行状态面板 */
.command-executing {
    padding: 16px;
    background-color: var(--vscode-editor-background, #1e1e1e);
    border: 1px solid var(--vscode-input-border, #3c3c3c);
    border-radius: 6px;
    margin: 12px 0;
}

.command-executing-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.command-executing-header .codicon-loading {
    animation: spin 1s linear infinite;
    color: var(--vscode-editorWarning-foreground, #cca700);
}

.command-executing-title {
    flex: 1;
    font-weight: 600;
    color: var(--vscode-foreground, #cccccc);
}

.command-cancel-btn {
    cursor: pointer;
    padding: 4px 8px;
    background-color: var(--vscode-button-secondaryBackground, #5a5a5a);
    color: var(--vscode-button-secondaryForeground, #fff);
    border: none;
    border-radius: 3px;
    font-size: 0.85em;
}

.command-cancel-btn:hover {
    background-color: var(--vscode-button-secondaryHoverBackground, #666);
}

/* 命令输出显示 */
.command-output {
    background-color: var(--vscode-terminal-background, #1e1e1e);
    border: 1px solid var(--vscode-input-border, #3c3c3c);
    border-radius: 4px;
    padding: 12px;
    font-family: var(--vscode-editor-font-family, 'Consolas', 'Courier New', monospace);
    font-size: 0.85em;
    line-height: 1.5;
    color: var(--vscode-terminal-foreground, #d4d4d4);
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.command-output.streaming {
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: var(--vscode-input-border, #3c3c3c);
    }
    50% {
        border-color: var(--vscode-editorWarning-foreground, #cca700);
    }
}

/* 命令输出中的错误信息 */
.command-output-error {
    color: var(--vscode-errorForeground, #f48771);
    background-color: var(--vscode-inputValidation-errorBackground, rgba(244, 135, 113, 0.1));
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
}

/* 命令执行结果摘要 */
.command-result-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background-color: var(--vscode-input-background, #3c3c3c);
    border-radius: 4px;
    margin-top: 12px;
    font-size: 0.9em;
}

.command-result-summary.success {
    background-color: rgba(78, 201, 176, 0.15);
    border-left: 3px solid var(--vscode-terminal-ansiGreen, #4ec9b0);
}

.command-result-summary.error {
    background-color: var(--vscode-inputValidation-errorBackground, rgba(244, 135, 113, 0.15));
    border-left: 3px solid var(--vscode-errorForeground, #f48771);
}

.command-result-summary .codicon {
    font-size: 14px;
}

.command-result-summary.success .codicon {
    color: var(--vscode-terminal-ansiGreen, #4ec9b0);
}

.command-result-summary.error .codicon {
    color: var(--vscode-errorForeground, #f48771);
}

/* 命令执行时长 */
.command-duration {
    margin-left: auto;
    font-size: 0.85em;
    color: var(--vscode-descriptionForeground, #999);
}

/* 退出码显示 */
.command-exit-code {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: 500;
    background-color: var(--vscode-badge-background, #4d4d4d);
    color: var(--vscode-badge-foreground, #fff);
}

.command-exit-code.success {
    background-color: rgba(78, 201, 176, 0.2);
    color: var(--vscode-terminal-ansiGreen, #4ec9b0);
}

.command-exit-code.error {
    background-color: rgba(244, 135, 113, 0.2);
    color: var(--vscode-errorForeground, #f48771);
}
